package com.kin207.netty.listener.server;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.kin207.netty.listener.ListenerConfig;
import com.kin207.netty.server.IServer;

public class InstanceServerListener extends MessageHandleRegisterServerListener {
	final static Logger logger = LoggerFactory.getLogger(InstanceServerListener.class);
	
	public void initialize(ListenerConfig cfg) {
		super.initialize(cfg);
		logger.info("cfg:{}", cfg);
	}

	public void created(IServer server) {
		super.created(server);
		server.getServerManager().addServer(server);
	}

	public void destroyed(IServer server) {
		super.destroyed(server);
		server.getServerManager().removeServer(server.getName());
		logger.info("destroyed");
	}
 
}
